package com.b00t.infra;

import com.google.gwt.dev.DevMode;

/**
 * 
 * @author rakesh
 *
 *  The main here starts the GWT dev mode and Jetty server
 */
public class StartDevMod {

    private static final int gwtPort = 9997;
    private static final int port = 8383;
    
    public static void main(String ar[]){
        final String homePage = "B00t.html";
    
        final String startupUrl = "http://localhost:" + port + "/" + homePage;
        String gwtModule= "com.b00t.B00t";
        
        //TODO: dont do this. get it from the classpath
		String currentdir = System.getProperty("user.dir");
        String outputPath = currentdir+"/"+"war";
        final String[] devModeArgs = {"-codeServerPort", String.valueOf(gwtPort), "-noserver", gwtModule, "-war", outputPath, "-startupUrl", startupUrl};

        DevMode.main(devModeArgs);
    	System.out.println("Starting GWT Dev mode client, path: " + startupUrl);
    }
    
    public static int getServerPort() {
    	return port;
	}


}
